package com.xuelang.pipeline.infrastructure.pipeline.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuelang.pipeline.domain.pipeline.VariableSetting;
import com.xuelang.pipeline.infrastructure.pipeline.dataobject.VariableSettingDO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>流水线变量配置Mapper类</p>
 *
 * @author : yixin.lys
 * @date : 2024-06-13 13:23
 **/
public interface VariableSettingMapper extends BaseMapper<VariableSettingDO> {

    /**
     * 批量插入
     * @param list
     * @param creatorId
     * @param createTime
     */
    void insertBatch(@Param("list") List<VariableSetting> list,
                     @Param("creatorId") String creatorId,
                     @Param("createTime") Date createTime);

    /**
     * 批量更新
     * @param list
     * @param updaterId
     * @param updateTime
     */
    void updateBatch(@Param("list") List<VariableSetting> list,
                     @Param("updaterId") String updaterId,
                     @Param("updateTime") Date updateTime);

    /**
     * 通过流水线模板uuid，批量插入流水线任务
     *
     * @param pipelineTemplateUuid
     * @param toPipelineCode
     * @param userId
     * @return
     */
    int batchInsertByPipelineTemplateUuid(
            @Param("pipelineTemplateUuid") String pipelineTemplateUuid,
            @Param("toPipelineCode") String toPipelineCode,
            @Param("userId") String userId);

}
